/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.hhx.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.hhx.entity.HhxUser;
import com.thinkgem.jeesite.modules.hhx.dao.HhxUserDao;

/**
 * 单表生成Service
 * @author zmy
 * @version 2019-04-08
 */
@Service
@Transactional(readOnly = true)
public class HhxUserService extends CrudService<HhxUserDao, HhxUser> {
	
	@Autowired
	private HhxUserDao hhxUserDao;

	public HhxUser get(String id) {
		return super.get(id);
	}
	
	public List<HhxUser> findList(HhxUser hhxUser) {
		return super.findList(hhxUser);
	}
	
	public Page<HhxUser> findPage(Page<HhxUser> page, HhxUser hhxUser) {
		return super.findPage(page, hhxUser);
	}
	
	@Transactional(readOnly = false)
	public void save(HhxUser hhxUser) {
		super.save(hhxUser);
	}
	
	@Transactional(readOnly = false)
	public void delete(HhxUser hhxUser) {
		super.delete(hhxUser);
	}

	public String getPsd(String username) {
		
		String psd = hhxUserDao.getPsd(username);
		return psd;
	}

	public HhxUser getInfoByName(String username) {
		
		return hhxUserDao.getInfoByName(username);
	}

	@Transactional(readOnly = false)
	public int updateFocus(String focusid, String focuscount) {
		// TODO Auto-generated method stub
		return hhxUserDao.updateFocus(focusid,focuscount);
	}

	@Transactional(readOnly = false)
	public int register(String id, String username, String password, String companyname, String webaddress,
			String address, String category, String range, String amt, String description, String tel, String truename,
			String idcard, String job) {
		// TODO Auto-generated method stub
		return hhxUserDao.insertUser(id,username,password,companyname,webaddress,address,category,range,amt,description,tel,truename,idcard,job);
	}

	@Transactional(readOnly = false)
	public int updateInvite(String invitedid) {
		// TODO Auto-generated method stub
		return hhxUserDao.updateInvite(invitedid);
	}

	@Transactional(readOnly = false)
	public int updateamt(String userid) {
		// TODO Auto-generated method stub
		return hhxUserDao.updateamt(userid);
	}

	@Transactional(readOnly = false)
	public int updateuser(String id) {
		// TODO Auto-generated method stub
		return hhxUserDao.updatestatus(id);
	}
	
}